<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML>
<html>
<head>
    <title>Bootstrap菜单</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath}/js/plugin/bootstrap-menu/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/js/plugin/bootstrap-menu/css/font-awesome.min.css">
    <script src="${pageContext.request.contextPath}/js/plugin/bootstrap-menu/js/jquery-1.8.2.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/plugin/bootstrap-menu/js/bootstrap.min.js"></script>
    <script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>

    <style type="text/css">
        body {
            color: #000;
            font-size: 12px;
            background-color: #f6f6f6;
            font-family: "Helvetica Neue",Helvetica,STheiti,微软雅黑,宋体,Arial,Tahoma,sans-serif,serif;
        }
        /*左侧菜单*/
        .sidebar-menu{
            border-right: 0px solid #c4c8cb;
        }
        /*一级菜单*/
        .menu-first{
            height:45px;
            line-height:45px;
            background-color: #e9e9e9;
            border-top: 1px solid #efefef;
            border-bottom: 1px solid #e1e1e1;
            padding: 0;
            font-size: 14px;
            font-weight: normal;
            text-align: center;
        }
        /*一级菜单鼠标划过状态*/
        .menu-first:hover{
            text-decoration: none;
            background-color: #d6d4d5;
            border-top: 1px solid #b7b7b7;
            border-bottom: 1px solid #acacac;
        }
        /*二级菜单*/
        .menu-second li a{
            background-color: #f6f6f6;
            height:31px;
            line-height:31px;
            border-top: 1px solid #efefef;
            border-bottom: 1px solid #efefef;
            font-size: 12px;
            text-align:center;
        }
        /*二级菜单鼠标划过样式*/
        .menu-second li a:hover {
            text-decoration: none;
            background-color: #66c3ec;
            border-top: 1px solid #83ceed;
            border-bottom: 1px solid #83ceed;
            border-right: 3px solid #f8881c;
            border-left: 3px solid #66c3ec;
        }
        /*二级菜单选中状态*/
        .menu-second-selected {
            background-color: #66c3ec;
            height:31px;
            line-height:31px;
            border-top: 1px solid #83ceed;
            border-bottom: 1px solid #83ceed;
            border-right: 3px solid #f8881c;
            border-left: 3px solid #66c3ec;
            text-align:center;
        }
        /*覆盖bootstrap的样式*/
        .nav-list,.nav-list li a{
            padding: 0px;
            margin: 0px;
        }

        .menu-left{
            text-align:left;margin-left: 40px;
        }
    </style>

    <script>
        $(document).ready(function() {
            parent.rightFrame.location= '<%=request.getContextPath() %>/devops/menu/my-general';
        });

        function jump(url,token){
            parent.rightFrame.location = url;
        }

        function doJump(jumpUrl){
            var url = '<%=request.getContextPath()%>/devops/account/getToken';
            JSendAjax(url,{"jumpUrl":jumpUrl});
        }

        function JCollBack(_data){
            if(_data.success){
                jump(_data.data.jumpUrl,_data.data.token);
            }
        }
    </script>
</head>

<body>
<!--Sidebar content-->
<div class="sidebar-menu">
    <a href="#common" class="nav-header menu-first" data-toggle="collapse"><div class="menu-left"><i class="icon-user-md icon-book"></i> 通用模块</div></a>
    <ul id="common" class="nav nav-list menu-second in collapse">
        <li><div class="menu-left"><a target="rightFrame"  href="<%=request.getContextPath() %>/devops/menu/account-list"><i class="icon-list"></i> 账户列表</a></div></li>
        <li><div class="menu-left"><a target="rightFrame"  href="<%=request.getContextPath() %>/devops/menu/menu-list"><i class="icon-list"></i> 菜单列表</a></div></li>
        <li><div class="menu-left"><a target="rightFrame" href="<%=request.getContextPath() %>/devops/menu/issue-list"><i class="icon-list"></i> 问题列表</a></div></li>
        <li><div class="menu-left"><a target="rightFrame"  href="<%=request.getContextPath() %>/devops/menu/pub-list"><i class="icon-list"></i> 发布列表</a></div></li>
    </ul>
    <c:forEach var="menu" items="${dto}" varStatus="index">
        <a href="#menu${menu.id}" class="nav-header menu-first collapsed" data-toggle="collapse"><div class="menu-left"><i class="icon-user-md icon-book"></i> ${menu.name}</div></a>
        <ul id="menu${menu.id}" class="nav nav-list collapse menu-second">
        <c:forEach var="c" items="${menu.children}" >
        <li><div class="menu-left"><a target="rightFrame" href="javascript:" onclick="doJump('${c.url}')"><i class="icon-list"></i> ${c.name}</a></div></li>
        </c:forEach>
        </ul>
     </c:forEach>
</div>
</body>
</html>
